operator>=() method from fcf::NTest::TimeDuration class
Class:
Package: fcfTest
File: test.hpp
Available from version: 1.2.5
Checks if a duration is greater than or equal to another.
The
Arguments
- The duration to compare against.
Result
- True if the duration is greater than or equal to the other, false otherwise.
Example: Greater-than-or-equal comparison
Demonstrating greater-than-or-equal checks.
#define FCF_TEST_IMPLEMENTATION
#include <fcfTest/test.hpp>
FCF_TEST_DEFINE ("TimeDemo", "Basics", "GreaterEqual") {
fcf::NTest::TimeDuration d1(1000ULL);
// 1. Compare with TimeDuration
FCF_TEST (d1 >= fcf::NTest::TimeDuration (1000ULL), d1.count());
// 2. Compare with arithmetic type
FCF_TEST (d1 >= 500ULL, d1.count());
}
int main(int a_argc, char* a_argv[]) {
bool error = false;
fcf::NTest::cmdRun (a_argc, a_argv, fcf::NTest::CRM_RUN , &error);
return error ? 1 : 0;
}
Output:
Performing the test: "TimeDemo" -> "Basics" -> "GreaterEqual" ...
[SUCCESS] Test completed successfully (0.000`000`000 sec)
[SUCCESS] All tests were completed.
Tests: 1 passed, 0 failed, 0 skipped, 1 total
Duration: 0.000`000`000 sec
VPSDime is an industry leading VPS hosting company that provides virtualized server services with high performance, availability and friendly support.